﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MTGenome.MTG
{
    public static class Extensions
    {
        public static bool UpdateCard(this ICard card, ICard newCard)
        {
            bool changed = false;

            if (card.Artist != newCard.Artist)
            {
                card.Artist = newCard.Artist;
                changed = true;
            }
            if (card.CardNumber != newCard.CardNumber)
            {
                card.CardNumber = newCard.CardNumber;
                changed = true;
            }
            if (card.Color != newCard.Color)
            {
                card.Color = newCard.Color;
                changed = true;
            }
            if (card.ConvertedManaCost != newCard.ConvertedManaCost)
            {
                card.ConvertedManaCost = newCard.ConvertedManaCost;
                changed = true;
            }
            if (card.Expansion != newCard.Expansion)
            {
                card.Expansion = newCard.Expansion;
                changed = true;
            }
            if (card.FlavorText != newCard.FlavorText)
            {
                card.FlavorText = newCard.FlavorText;
                changed = true;
            }
            if (card.Loyalty != newCard.Loyalty)
            {
                card.Loyalty = newCard.Loyalty;
                changed = true;
            }
            if (card.ManaCost != newCard.ManaCost)
            {
                card.ManaCost = newCard.ManaCost;
                changed = true;
            }
            if (card.Name != newCard.Name)
            {
                card.Name = newCard.Name;
                changed = true;
            }
            if (card.Power != newCard.Power)
            {
                card.Power = newCard.Power;
                changed = true;
            }
            if (card.Rarity != newCard.Rarity)
            {
                card.Rarity = newCard.Rarity;
                changed = true;
            }
            if (card.Text != newCard.Text)
            {
                card.Text = newCard.Text;
                changed = true;
            }
            if (card.Toughness != newCard.Toughness)
            {
                card.Toughness = newCard.Toughness;
                changed = true;
            }
            if (card.Type != newCard.Type)
            {
                card.Type = newCard.Type;
                changed = true;
            }
            if (card.PowerToughnessText != newCard.PowerToughnessText)
            {
                card.PowerToughnessText = newCard.PowerToughnessText;
                changed = true;
            }
            return changed;
        }
    }
}
